<thead>
<tr>
    <th style="width:25px;"><input type='checkbox'/></th>
    <th style="width:50px;">排序</th>
    <th style="width:70px;">商品标题</th>
    <th style="width:170px;">&nbsp;</th>
    <th style="width:80px;text-align: right;">团购价</th>
    <th style="width:80px;text-align: right;">单购价</th>
    <th style="width:80px;text-align: center;">库存</th>
    <th style="width:80px;text-align: center;">销量</th>
    <th style="width:50px;text-align: center;">状态</th>
    <th style="text-align: center;">操作</th>
</tr>
</thead>
<tbody>
{if $list}
{loop $list $row}
<tr>
    <td><input type='checkbox' value="{$row['id']}"/></td>
    <td> {ifp 'groups.goods.edit'}
        <a href='javascript:;' data-toggle='ajaxEdit' data-href="{php echo webUrl('groups/goods/property',array('type'=>'displayorder','id'=>$row['id']))}">{$row['displayorder']}</a>
        {else}
        {$row['displayorder']}
        {/if}
    </td>
    <td><img src="{php echo tomedia($row['thumb'])}" style="width:40px;height:40px;padding:1px;border:1px solid #ccc;"/>
    </td>
    <td>
        <!--{if !empty($row['subtitle'])}<span class='label label-warning'>{$row['subtitle']}</span>{/if}-->
        <span class='label label-primary'>{$row['name']}</span><br/>{$row['title']}
    </td>
    <td style="text-align: right;">{$row['groupsprice']}</td>
    <td style="text-align: right;">{if $row['singleprice']}{$row['singleprice']}{else}--{/if}</td>
    <td style="text-align: center;">{$row['stock']}</td>
    <td style="text-align: center;">
        {$row['sales']}
        <!--<span class='label {if $row['ishot']==1}label-success{else}label-default{/if}'
        {ifp 'groups.goods.edit'}
        data-toggle='ajaxSwitch'
        data-switch-value='{$row['ishot']}'
        data-switch-value0='0|否|label label-default|{php echo webUrl('groups/goods/property',array('type'=>'ishot', 'value'=>1,'id'=>$row['id']))}'
        data-switch-value1='1|是|label label-success|{php echo webUrl('groups/goods/property',array('type'=>'ishot', 'value'=>0,'id'=>$row['id']))}'
        {/if}>{if $row['ishot']==1}否{else}是{/if}</span>-->
    </td>
    <td style="text-align: center;">
        <span class='label {if $row['status']==1}label-success{else}label-default{/if}'
        {ifp 'groups.goods.edit'}
        data-toggle='ajaxSwitch'
        data-switch-value='{$row['status']}'
        data-switch-value0='0|下架|label label-default|{php echo webUrl('groups/goods/property',array('type'=>'status', 'value'=>1,'id'=>$row['id']))}'
        data-switch-value1='1|上架|label label-success|{php echo webUrl('groups/goods/property',array('type'=>'status', 'value'=>0,'id'=>$row['id']))}'
        {/if}>{if $row['status']==1}上架{else}下架{/if}</span>
    </td>
    <td style="text-align: center;">
        {ifp 'groups.goods.view|groups.goods.edit'}
        <a class='btn btn-default btn-sm' href="{php echo webUrl('groups/goods/edit',array('id' => $row['id']));}">
            <i class='fa fa-edit'></i> {ifp 'groups.goods'}编辑{else}查看{/if}
        </a>
        {/if}
        {ifp 'groups.goods.delete'}
        <a class='btn btn-default btn-sm' data-toggle='ajaxRemove' href="{php echo webUrl('groups/goods/delete',array('id' => $row['id']));}" data-confirm="确定要删除该商品吗？">
            <i class='fa fa-remove'></i> 删除
        </a>
        {/if}
    </td>
</tr>
{/loop}
{else}
<tr>
    <td colspan="10" style="text-align: center;">暂时没有任何商品!</td>
</tr>
{/if}
</tbody>